Token Syntax
Tokens have the following format (syntax): %(TokenName) or %(ActivityName_TokenName). This syntax lets both you and the software know when a bit of text will behave like a token.
Note: The syntax used for tokens has changed from Laserfiche 7 to Laserfiche 8 and higher. All tokens should now be in the following format: %(token).
You can edit the syntax even further if you want to apply functions, indexing, formatting, or regular expressions. However, the Token Dialog and Token Editor will automatically create this syntax for you when you choose different options in these dialog boxes.
Functions: %(TokenName#@FunctionName@#). The function's name is placed between #@ and @#. Multiple functions are separated by a semi colon. If the function has a parameter, such as if you specified a delimiter for the Split function, then the parameter is placed between parentheses: %(TokenName#@FunctionName(Parameter)@#). If the function has more than one parameter, the parameters are separated by a comma.
Indexing: %(TokenName_All#[n]#) where n equals the index number of the value you want the token to be replaced by. The syntax to have a token be replaced by all values separated by a delimiter is: %(TokenName_All#[delimiter]#). The delimiter is placed between #[ and ]#.
Formatting: %(TokenName#".NET formatting expression"#). A .NET formatting expression is placed between #" and "#. More information.
Regular Expressions: %(TokenName#<RegularExpression>#). The regular expression is placed between #< and >#, directly after the token name. For example, this syntax %(RetrievePDFFormContents_Address#<\d\d\d\d\d$>#) extracts the zip code from an address.
The forward slash character "/" is an escape character in token syntax. You should escape any characters that will make the token's syntax ambiguous. Show me an example. The Token Dialog and Token Editor automatically escape characters when necessary.
Example: If you precede a token with a forward slash, when the workflow runs the token itself will be returned and not its value. For instance, you want to use a token when constructing a URL, and you type: http://CompanyName/%(EmployeeID). When the workflow runs, the /%(EmployeeID) will be replaced with the characters /%(EmployeeID) instead of a forward slash and the token value. To return the token value, escape the forward slash with another forward slash. For example, http://CompanyName //%(EmployeeID) would return http://CompanyName/12345
Example: You want to delimit a multi-value token with the character "]". Because "]" has syntactic meaning when indexing a token, you will need to escape it in the token's syntax: %(TokenName_All#[/]]).